/*
 * mmap-manager.h
 *
 *  Created on: Sep 30, 2016
 *      Author: zhangzm
 */

#ifndef MMAP_MANAGER_H_
#define MMAP_MANAGER_H_

struct MMapPair
{
	int fd;
	int offset;
	int pipe[2];
	MMapPair(int fd = 0, int offset = 0){
		this->fd = fd;
		this->offset = offset;
		pipe[0] = -1;
		pipe[1] = -1;
	}
};

void add_mmap(int fd, int offset, void* p, int pipe[2]);
void del_mmap(void* p);
struct MMapPair search_mmap(void* p);

#endif /* MMAP_MANAGER_H_ */
